/**
 * Project: complex.spring.mvc
 * 
 * File Created at 2010-8-17
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.complex.spring.mvc.controller;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * TODO Comment of UpdateController
 * @author wb_liang.gao
 *
 */
@Controller
@RequestMapping("/update.controller")//映射关系(发布的handlerMapping)
public class UpdateController {
    private static final Log logger = LogFactory.getLog(UpdateController.class);
    
    @RequestMapping(method={RequestMethod.GET,RequestMethod.POST})
    public ModelAndView handleRequest(HttpServletRequest request,
            HttpServletResponse response,String name) throws Exception {
       
        //输出log信息
        if(logger.isInfoEnabled()){
            logger.info("=======================UpdateController handleRequest=======================name="+request.getParameter("name"));
        }
        //处理业务逻辑
        //loginService.doLogin();
        
        //设置返回数据
        HashMap<String,String> param = new HashMap<String,String>();
        param.put("name", request.getParameter("name"));
        //返回到login.jsp
        return new ModelAndView("jsp/update.jsp",param);
    }
}
